package com.monitor.controller;

import com.monitor.dto.AdminDTO;
import com.monitor.dto.AdminPageDTO;
import com.monitor.model.Admin;
import com.monitor.modelExt.AdminExt;
import com.monitor.pubInter.BaseSearch;
import com.monitor.pubInter.IBaseService;
import com.monitor.pubInter.exception.SkException;
import com.monitor.searchExt.AdminSearchExt;
import com.monitor.service.IAdminService;
import com.monitor.vo.AdminDetailDomainVO;
import com.monitor.vo.AdminDetailVO;
import com.monitor.vo.AdminDomainVO;
import com.monitor.vo.AdminListVO;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/admin/")
@RestController(value = "adminController")
public class AdminController extends ApiManageController<AdminDTO,AdminPageDTO, AdminExt, AdminSearchExt, AdminDomainVO, AdminDetailDomainVO, AdminDetailVO, AdminListVO,String> {

    @Autowired
    private IAdminService adminService;
    @Override
    public IBaseService getBaseService() throws SkException {
        return adminService;
    }



    @RequestMapping("test")
    public String test(HttpServletRequest request, HttpSession response) throws SkException {
        AdminSearchExt adminSearchExt=AdminSearchExt.getInstance();
        adminSearchExt.setOrderBy(Admin.SORT_NUM);
        adminSearchExt.setOrderDesc(BaseSearch.ASC_ORDER);
        adminService.getAllList(adminSearchExt);
        listCount(null,request,response);
        return  "test";
    }


}
